package org.thss.petri.gef.figures;

import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.LineBorder;
import org.eclipse.draw2d.XYLayout;
import org.eclipse.draw2d.geometry.Rectangle;

public class TransitionFigure extends NodeFigure {
	public static int DEFAULT_WIDTH = 50;
	public static int DEFAULT_HEIGHT = 80 + NAME_LABEL_HEIGHT;
	
	public TransitionFigure() {
		shape = new Label();
		shape.setBorder(new LineBorder(1));
		shape.setOpaque(true);
		add(shape);
	}
	
	@Override
	protected void paintFigure(Graphics graphics) {
		super.paintFigure(graphics);
	}
	
	public void setEnabled(boolean enabled) {
		Label label = (Label) shape;
		if (enabled) {
			label.setText(">");
			label.setForegroundColor(ColorConstants.red);
		}
		else {
			label.setText("");
			label.setForegroundColor(ColorConstants.black);
		}
	}
}
